Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/customizable extent #19

Merged
merged 3 commits into from
May 20, 2024
Merged

Feat/customizable extent #19

merged 3 commits into from
May 20, 2024

Conversation

bordoray
Copy link
Contributor

Issue

close #14

テスト手順:Test

  • 領域の指定を諸々で試す
    • Map Canvas
    • 四角を指定
    • レイヤの領域
    • などなど
      image

@bordoray bordoray requested a review from kntoshiya May 15, 2024 06:21
Copy link
Contributor

coderabbitai bot commented May 15, 2024

Walkthrough

全体の変更は、コードのリファクタリングと構造改善に焦点を当てています。変数の名称変更、コードの再フォーマット、関数パラメータの調整が行われ、主なロジックと制御フローはほとんど変更されていません。また、衛星データ取得範囲の指定機能が追加され、QGISのCRSと範囲設定機能が強化されています。

Changes

ファイル 変更内容
jaxa/earth/image/collection/bounds/set.py 変数の名称変更、コードの再フォーマット、関数パラメータの調整、新関数の追加(geoj2bbox, bbox2geojson, flatten_list, fix_bbox, set_bbox_qgis
jaxaEarthApiDialog.py qgis.utilsからifaceをインポート、変数名の修正(logitudelongitude)、経度比較ロジックの更新、mExtentGroupBoxの出力CRSと範囲設定機能の追加、データセット読み込み時の範囲フィルタリング機能の追加
jaxaEarthApiDialog.ui レイアウトの行3列1にQgsExtentGroupBoxウィジェットを追加、QgsCollapsibleGroupBoxを拡張するカスタムウィジェット定義の追加

Assessment against linked issues

目的 対応 説明
衛星データ取得範囲の指定機能 (#14)

変化の風が吹き渡る、
コードの森に新たな道、
範囲を定め、衛星の目、
明日のデータが煌めくよ。


Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Out of diff range and nitpick comments (1)
jaxaEarthApiDialog.py (1)

Line range hint 22-26: import * の使用は避けるべきです。明示的に必要なクラスや関数をインポートすることをお勧めします。

- from PyQt5.QtCore import *
- from PyQt5.QtGui import *
- from PyQt5.QtWidgets import *
- from qgis.core import *
- from qgis.gui import *
+ from PyQt5.QtCore import QDateTime, pyqtSignal, QDateTime
+ from PyQt5.QtGui import QIcon
+ from PyQt5.QtWidgets import QDialog, QMessageBox
+ from qgis.core import QgsProject, QgsCoordinateReferenceSystem, QgsCoordinateTransform, QgsRectangle, QgsDateTimeRange
+ from qgis.gui import QgsMapCanvas
Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 2f3bf65 and 83bb562.
Files selected for processing (3)
  • jaxa/earth/image/collection/bounds/set.py (2 hunks)
  • jaxaEarthApiDialog.py (5 hunks)
  • jaxaEarthApiDialog.ui (1 hunks)
Additional Context Used
Ruff (24)
jaxa/earth/image/collection/bounds/set.py (1)

103-103: Ambiguous variable name: l

jaxaEarthApiDialog.py (23)

22-22: from PyQt5.QtCore import * used; unable to detect undefined names


23-23: from PyQt5.QtGui import * used; unable to detect undefined names


24-24: from PyQt5.QtWidgets import * used; unable to detect undefined names


25-25: from qgis.core import * used; unable to detect undefined names


26-26: from qgis.gui import * used; unable to detect undefined names


84-84: QDialog may be undefined, or defined from star imports


85-85: pyqtSignal may be undefined, or defined from star imports


145-145: QgsProject may be undefined, or defined from star imports


147-147: QgsProject may be undefined, or defined from star imports


149-149: QgsProject may be undefined, or defined from star imports


201-201: QDateTime may be undefined, or defined from star imports


207-207: QDateTime may be undefined, or defined from star imports


214-214: QDateTime may be undefined, or defined from star imports


225-225: QDateTime may be undefined, or defined from star imports


249-249: QDateTime may be undefined, or defined from star imports


260-260: QDateTime may be undefined, or defined from star imports


276-276: QMessageBox may be undefined, or defined from star imports


307-307: QMessageBox may be undefined, or defined from star imports


338-338: QgsDateTimeRange may be undefined, or defined from star imports


339-339: QDateTime may be undefined, or defined from star imports


340-340: QDateTime may be undefined, or defined from star imports


346-346: QgsProject may be undefined, or defined from star imports


351-351: QgsProject may be undefined, or defined from star imports

Additional comments not posted (8)
jaxaEarthApiDialog.ui (2)

190-192: 新しい QgsExtentGroupBox ウィジェットが追加されました。これにより、ユーザーは空間範囲を設定できるようになります。変更は適切です。


195-202: QgsExtentGroupBox のカスタムウィジェット定義が追加されました。これにより、ウィジェットが正しく機能するための設定が行われています。変更は適切です。

jaxa/earth/image/collection/bounds/set.py (4)

Line range hint 56-70: geoj2bbox 関数は、GeoJSON からバウンディングボックスを計算します。コードは適切であり、特に問題は見当たりません。


78-94: bbox2geojson 関数は、バウンディングボックスから GeoJSON を生成します。コードは適切であり、特に問題は見当たりません。


114-153: fix_bbox 関数は、バウンディングボックスの範囲を修正します。コードは適切であり、特に問題は見当たりません。


160-191: set_bbox_qgis 関数は、QGIS の表示範囲からバウンディングボックスを設定します。コードは適切であり、特に問題は見当たりません。

jaxaEarthApiDialog.py (2)

143-152: QgsExtentGroupBox の統合は適切に行われています。特に問題は見当たりません。


286-292: load_dataset 関数での範囲の処理は適切です。特に問題は見当たりません。

Comment on lines +102 to 109
# --------------------------------------------------------------------------------
def flatten_list(l):
for el in l:
if isinstance(el, list):
yield from flatten_list(el)
else:
yield el

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

変数名 l は曖昧です。より説明的な名前に変更することをお勧めします。

- def flatten_list(l):
+ def flatten_list(nested_list):

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
# --------------------------------------------------------------------------------
def flatten_list(l):
for el in l:
if isinstance(el, list):
yield from flatten_list(el)
else:
yield el
# --------------------------------------------------------------------------------
def flatten_list(nested_list):
for el in nested_list:
if isinstance(el, list):
yield from flatten_list(el)
else:
yield el

@bordoray bordoray requested a review from nbayashi May 16, 2024 04:08
Copy link
Contributor

@nbayashi nbayashi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

動作確認しました。問題ないかと思います

@nbayashi
Copy link
Contributor

OK

@nbayashi nbayashi merged commit fea4847 into master May 20, 2024
2 checks passed
@bordoray bordoray deleted the feat/customizable-extent branch May 27, 2024 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

衛星データ取得範囲の指定機能
2 participants